#include<bits/stdc++.h>
#define ll long long
#define mkp make_pair
using namespace std;
const int mod1=1e9+7;
const int mod2=1e9+9;
const int base=131;
const int maxn=2e6+5;
int n,k;
ll a,b;
char s[maxn];
unordered_map<ll, int> mxc,lst,cnt[30];
ll hh1[maxn],hh2[maxn],p1[maxn],p2[maxn];
inline ll get_hh1(int l,int r)
{
	return ((hh1[r]-hh1[l-1]*p1[r-l+1])%mod1+mod1)%mod1;
}
inline ll get_hh2(int l,int r)
{
	return ((hh2[r]-hh2[l-1]*p2[r-l+1])%mod2+mod2)%mod2;
}
inline ll get_hh(int l,int r)
{
	return get_hh1(l,r)*mod2+get_hh2(l,r);
}
int main()
{
	freopen("string.in","r",stdin);
	freopen("string.out","w",stdout);
	int pos,c,len;
	ll w;
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	cin>>n>>k>>a>>b;
	for(int i=1;i<=n;i++) cin>>s[i];
	p1[0]=p2[0]=1;
	for(int i=1;i<=n;i++)
	{
		hh1[i]=(hh1[i-1]*base+s[i])%mod1;
		p1[i]=p1[i-1]*base%mod1;
		hh2[i]=(hh2[i-1]*base+s[i])%mod2;
		p2[i]=p2[i-1]*base%mod2;
		if(i>=k) lst[get_hh(i-k+1,i)]=i;
		if(i>k)
		{
			w=get_hh(i-k,i-1),c=s[i]-'a';
			cnt[c][w]++;
			if(mkp(-cnt[c][w],c)<mkp(-cnt[mxc[w]][w],mxc[w])) mxc[w]=c;
		}
	}
	for(int i=n+1;i<=2*n;i++)
	{
		w=get_hh(i-k,i-1);
		s[i]='a'+mxc[w];
		hh1[i]=(hh1[i-1]*base+s[i])%mod1;
		hh2[i]=(hh2[i-1]*base+s[i])%mod2;
		w=get_hh(i-k+1,i);
		if(lst[w]>=n)
		{
			len=i-lst[w],pos=lst[w];
			for(ll j=a;j<=b;j++)
			{
				if(j<=i) cout<<s[j];
				else cout<<s[pos+1+(j-pos-1)%len];
			}
			cout<<'\n';
			break;
		}
		lst[w]=i;
	}
	return 0;
}
